/*
 * PantallaLlamada.java
 * @autor: T-Complement
 * Created on 8/06/2009, 09:03:58 AM
 */

package iuTaxSimula;

public class PantallaLlamada extends javax.swing.JFrame {

    private AsignarServicio asignarServicio;
    private int operacion;

    public AsignarServicio getAsignarServicio() {
        return asignarServicio;
    }

    public int getOperacion() {
        return operacion;
    }

    public PantallaLlamada(AsignarServicio asignarServicio, int operacion) {
        this.asignarServicio = asignarServicio;
        this.operacion = operacion;
    }
  
    /** Creates new form PantallaLlamada */
    public PantallaLlamada() {
        initComponents();
     }

    /**This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelPantallaLlamada = new javax.swing.JPanel();
        jLabelPantallaLlamada1 = new javax.swing.JLabel();
        jLabelPantallaLlamada2 = new javax.swing.JLabel();
        jLabelPantallaLlamada3 = new javax.swing.JLabel();
        jLabelPantallaLlamada4 = new javax.swing.JLabel();
        jTextFieldPantallaLlamadaTel = new javax.swing.JTextField();
        jTextFieldPantallaLlamadaCalle = new javax.swing.JTextField();
        jTextFieldPantallaLlamadaCarrera = new javax.swing.JTextField();
        jButtonPantallaLlamadaAceptar = new javax.swing.JButton();
        jButtonPantallaLlamadaModificar = new javax.swing.JButton();
        jButtonPantallaLlamadaCancelar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabelPantallaLlamada1.setFont(new java.awt.Font("Tahoma", 0, 18));
        jLabelPantallaLlamada1.setText("DATOS LLAMADA ACTUAL");

        jLabelPantallaLlamada2.setText("Teléfono: ");

        jLabelPantallaLlamada3.setText("Calle: ");

        jLabelPantallaLlamada4.setText("Carrera: ");

        jTextFieldPantallaLlamadaTel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextFieldPantallaLlamadaTelActionPerformed(evt);
            }
        });

        jButtonPantallaLlamadaAceptar.setText("Aceptar");
        jButtonPantallaLlamadaAceptar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButtonPantallaLlamadaAceptarMouseClicked(evt);
            }
        });

        jButtonPantallaLlamadaModificar.setText("Modificar");
        jButtonPantallaLlamadaModificar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButtonPantallaLlamadaModificarMouseClicked(evt);
            }
        });

        jButtonPantallaLlamadaCancelar.setText("Cancelar");
        jButtonPantallaLlamadaCancelar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButtonPantallaLlamadaCancelarMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanelPantallaLlamadaLayout = new javax.swing.GroupLayout(jPanelPantallaLlamada);
        jPanelPantallaLlamada.setLayout(jPanelPantallaLlamadaLayout);
        jPanelPantallaLlamadaLayout.setHorizontalGroup(
            jPanelPantallaLlamadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelPantallaLlamadaLayout.createSequentialGroup()
                .addContainerGap(101, Short.MAX_VALUE)
                .addComponent(jLabelPantallaLlamada1)
                .addGap(92, 92, 92))
            .addGroup(jPanelPantallaLlamadaLayout.createSequentialGroup()
                .addGap(119, 119, 119)
                .addGroup(jPanelPantallaLlamadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelPantallaLlamada2)
                    .addGroup(jPanelPantallaLlamadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jLabelPantallaLlamada3)
                        .addComponent(jLabelPantallaLlamada4)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelPantallaLlamadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextFieldPantallaLlamadaCarrera)
                    .addComponent(jTextFieldPantallaLlamadaTel, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE)
                    .addComponent(jTextFieldPantallaLlamadaCalle))
                .addContainerGap(135, Short.MAX_VALUE))
            .addGroup(jPanelPantallaLlamadaLayout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addComponent(jButtonPantallaLlamadaAceptar)
                .addGap(58, 58, 58)
                .addComponent(jButtonPantallaLlamadaModificar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE)
                .addComponent(jButtonPantallaLlamadaCancelar)
                .addGap(37, 37, 37))
        );
        jPanelPantallaLlamadaLayout.setVerticalGroup(
            jPanelPantallaLlamadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPantallaLlamadaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelPantallaLlamada1)
                .addGap(40, 40, 40)
                .addGroup(jPanelPantallaLlamadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelPantallaLlamada2)
                    .addComponent(jTextFieldPantallaLlamadaTel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(29, 29, 29)
                .addGroup(jPanelPantallaLlamadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelPantallaLlamada3)
                    .addComponent(jTextFieldPantallaLlamadaCalle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(34, 34, 34)
                .addGroup(jPanelPantallaLlamadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelPantallaLlamada4)
                    .addComponent(jTextFieldPantallaLlamadaCarrera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(56, 56, 56)
                .addGroup(jPanelPantallaLlamadaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonPantallaLlamadaAceptar)
                    .addComponent(jButtonPantallaLlamadaCancelar)
                    .addComponent(jButtonPantallaLlamadaModificar))
                .addContainerGap(25, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelPantallaLlamada, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelPantallaLlamada, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTextFieldPantallaLlamadaTelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextFieldPantallaLlamadaTelActionPerformed
            // TODO add your handling code here:
    }//GEN-LAST:event_jTextFieldPantallaLlamadaTelActionPerformed

    private void jButtonPantallaLlamadaAceptarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonPantallaLlamadaAceptarMouseClicked
     operacion=1;   // TODO add your handling code here:
    }//GEN-LAST:event_jButtonPantallaLlamadaAceptarMouseClicked

    private void jButtonPantallaLlamadaModificarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonPantallaLlamadaModificarMouseClicked
    operacion=2;    // TODO add your handling code here:
    }//GEN-LAST:event_jButtonPantallaLlamadaModificarMouseClicked

    private void jButtonPantallaLlamadaCancelarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonPantallaLlamadaCancelarMouseClicked
    operacion=3;   // TODO add your handling code here:
    }//GEN-LAST:event_jButtonPantallaLlamadaCancelarMouseClicked

    /**
     * Muestra los datos de la llamada de solicitud del servicio
     * @param telefono
     * @param calle
     * @param carrera
     */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonPantallaLlamadaAceptar;
    private javax.swing.JButton jButtonPantallaLlamadaCancelar;
    private javax.swing.JButton jButtonPantallaLlamadaModificar;
    private javax.swing.JLabel jLabelPantallaLlamada1;
    private javax.swing.JLabel jLabelPantallaLlamada2;
    private javax.swing.JLabel jLabelPantallaLlamada3;
    private javax.swing.JLabel jLabelPantallaLlamada4;
    private javax.swing.JPanel jPanelPantallaLlamada;
    private javax.swing.JTextField jTextFieldPantallaLlamadaCalle;
    private javax.swing.JTextField jTextFieldPantallaLlamadaCarrera;
    private javax.swing.JTextField jTextFieldPantallaLlamadaTel;
    // End of variables declaration//GEN-END:variables
    
    public void mostrarDatosLlamada(String telefono, int calle, int carrera){
        jTextFieldPantallaLlamadaTel.setText(telefono);
        jTextFieldPantallaLlamadaCalle.setText(toString().valueOf(calle));
        jTextFieldPantallaLlamadaCarrera.setText(toString().valueOf(carrera));
    }
}
